/*
 * Copyright 2012-2014 glodon paas All right reserved. This software is the
 * confidential and proprietary information of glodon paas ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with glodon paas.
 */
package com.glodon.paas.framework.dto;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @author licx 2013-1-31 下午3:06:42
 */
public class PaginationQueryList<E> extends ArrayList<E> {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= -2594132466813480000L;
	private BaseQuery			query;

	public PaginationQueryList() {
		super();
		this.query = new BaseQuery();
	}

	public PaginationQueryList(BaseQuery query) {
		super();
		this.query = query;
	}

	public PaginationQueryList(Collection c) {
		super(c);
	}

	public PaginationQueryList(Collection c, BaseQuery query) {
		super(c);
		this.query = query;
	}

	public BaseQuery getQuery() {
		return query;
	}

	public void setQuery(BaseQuery query) {
		this.query = query;
	}

	public int getTotalItem() {
		return query.getTotalItem() != null ? query.getTotalItem().intValue() : 0;
	}

	public void setTotalItem(int totalItem) {
		query.setTotalItem(new Integer(totalItem));
	}

	public int getTotalPage() {
		return query.getTotalPage();
	}

	public int getPageSize() {
		return query.getPageSize() != null ? query.getPageSize().intValue() : 0;
	}

}
